#include "kukaseamtechonlasersensorinstance.h"
#include "kukaseamtechonlasersensorinstance_global.h"

static KUKASeamTechonLaserSensorInstance* pInstance = nullptr;

short KPLU_SeamTechKPluginInstanceCreate(short Local_Remote){
    if(pInstance == nullptr) pInstance = new KUKASeamTechonLaserSensorInstance(Local_Remote);
    return NOERROR;
}
short KPLU_SeamTechKPluginInstanceDelete(){
    if(pInstance != nullptr) delete pInstance;
    return NOERROR;
}
short KPLU_SeamTechKPluginInstanceExists(){
    if(pInstance != nullptr) return true;
    else                     return false;
}
QWidget* KPLU_SeamTechKPluginInstanceUiRegesiter(){
    if(pInstance != nullptr){
        return pInstance->getUiHandle();
    }
    else{
        return nullptr;
    }
}

void  TASK_mainloop_toRobotKRLReceiveLoopRun(){
    if(pInstance != nullptr){
        pInstance->task_mainloop_toRobotKRLReceiveLoopRun();
    }
}
void  TASK_mainloop_toRobotKRLSendLoopRun(){
    if(pInstance != nullptr){
        pInstance->task_mainloop_toRobotKRLSendLoopRun();
    }
}
void  TASK_mainloop_toLaserSensorReceive(){
    if(pInstance != nullptr){
        pInstance->task_mainloop_toLaserSensorReceive();
    }
}
void  TASK_mainloop_toLaserSensorSend(){
    if(pInstance != nullptr){
        pInstance->task_mainloop_toLaserSensorSend();
    }
}

void  TASK_mainloop_SeamTechTCPThreadLoopRun(){
    if(pInstance != nullptr){
        pInstance->task_mainloop_SeamTechTCPThreadLoopRun();
    }
}
void  TASK_kukaloop_SeamTechUDPThreadLoopRun(){
    if(pInstance != nullptr){
        pInstance->task_kukaloop_SeamTechUDPThreadLoopRun();
    }
}
void  COM_RemoteDataRecv(QByteArray Data){
    if(pInstance != nullptr){
        pInstance->task_com_RemoteDataRecv(Data);
    }
}
void  COM_RemoteDataSend(QByteArray& Data){
    if(pInstance != nullptr){
        pInstance->task_com_RemoteDataSend(Data);
    }
}

void TASK_uifast_UiDataUpdate(){
    if(pInstance != nullptr){
        pInstance->task_uifast_UiDataUpdate();
    }
}
void TASK_uifast_LaserDataScopeUpdate(){
    if(pInstance != nullptr){
        pInstance->task_uifast_LaserDataScopeUpdate();
    }
}

void TASK_mainloop_LaserSensorDataSave(){
    if(pInstance != nullptr){
        pInstance->task_mainloop_LaserSensorDataSave();
    }
}
